This invention relates to triangulation type distance sensors utilizing image sensors, and more particularly to those suited for continuously measuring the distance to a moving object such as an automobile.
A typical organization of a triangulation type distance sensor utilizing image sensors is shown in FIG. 4, which is disclosed, for example, in Japanese Patent Publication (Kokoku) No. 63-46363 or Japanese Patent Laid-Open (Kokai) No. 61-139715. As shown in FIG. 4, the sensor comprises a pair of objective lenses 1 and 2 of a right and a left optical system separated from each other by a base length L. Image sensors 3 and 4, consisting, for example, of charged coupled devices (CCD), are positioned behind the lenses 1 and 2 respectively at the focal distance f. Thus, the object 5 at a distance R from the distance sensor forms a left and a right image on the image sensors 3 and 4, respectively. The analog signals outputted from the image sensors 3 and 4 are converted into corresponding digital signals via the A/D converters 6 and 7, respectively, and stored in the memories 8 and 9. It is noted that the images formed on the image sensors 3 and 4, and hence those stored in the memories 8 and 9, are displaced from each other by a horizontal distance corresponding to the distance R of the object 5 from the distance sensor. Thus, a microprocessor 10 determines the distance R on the basis of the information stored in the memories 8 and 9 as follows:
First, the microprocessor 10 calculates a first accumulated difference of the pixel signals of the left and the right image when the two images are superposed on each other without a shift. Thus, the microcomputer 10 first reads out from memory 8 a pixel signal corresponding to the pixel at the top left corner of the image sensor 3, and then from memory 9 a pixel signal corresponding to the pixel at the top left corner of the image sensor 4, and calculates the absolute value of the difference between the two pixel signals. Next, the microprocessor 10 reads out from memories 8 and 9 the pixel signals corresponding to the pixels at the right of the first pixels, calculates the absolute value of the difference therebetween, and accumulates the second absolute value with the first absolute value (i.e., calculates the sum of the two absolute values of the differences). The microprocessor 10 repeats the above operation until all the pixels of the image sensors 3 and 4 are processed successively, thereby obtaining a first accumulated value of the absolute differences. This first accumulated value represents the accumulated differences of the two images on the image sensors 3 and 4 when the two images are superposed on each other without a shift.
Next, the microprocessor 10 calculates a second accumulated difference of the pixel signals where the image on the sensor 4 is shifted to the right by one pixel pitch with respect to the left image formed on the sensor 3. Thus, the microprocessor 10 first reads out from memory 8 a pixel signal corresponding to the pixel at the top left corner of the image sensor 3, and then from memory 9 a pixel signal corresponding to the pixel at the right of the top left pixel of the image sensor 4, and calculates the absolute value of the difference between the two pixel signals. Next, the microprocessor 10 reads out from memories 8 and 9 the pixel signals corresponding to the pixels at the right of the first-read pixels, respectively, calculates the absolute value of the difference therebetween, and accumulates the second absolute value of the difference on the first absolute value. The operation is repeated until all the overlapping pixels of the two images are processed, thereby obtaining the second accumulated difference.
Further, the right image on the image sensor 4 is repeatedly shifted by one pixel each time with respect to the image on the image sensor 3, and accumulated differences of the two images are obtained after each shift. The magnitude of the shift at which the accumulated difference is at the minimum corresponds to the displacement of the two images on the sensors 3 and 4. If the shift of the right image with respect to the left is equal to n pixels and the horizontal pitch of the pixels is p, the displacement of the two images is equal to the product (n.p.). Thus, by the principle of triangulation, the distance R to the object 5 is obtained by: EQU R=f.multidot.L/n.multidot.p
where f is the focal length of the lenses 1 and 2 and L is the base length of the optical system.
The above conventional distance sensor, however, has the following disadvantage. The distance sensor is only capable of determining a distance to an object which lies in the direction of the optical axis of the sensor. Thus, in order to detect the distance to a moving object, it is necessary to direct the optical axis thereto. In the case of the conventional distance sensors, it is necessary to move the sensor in accordance with the moving object, which makes stable measurement of the distance difficult to perform.